package com.aiyige.page.publish.selecttag.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by zhuyakun on 2017/11/9.
 */

public class SelectTagItem implements Parcelable {
    String name;
    String id;

    public SelectTagItem() {
    }


    private SelectTagItem(Builder builder) {
        setName(builder.name);
        setId(builder.id);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }


    public static final class Builder {
        private String name;
        private String id;

        private Builder() {
        }

        public Builder name(String name) {
            this.name = name;
            return this;
        }

        public Builder id(String id) {
            this.id = id;
            return this;
        }

        public SelectTagItem build() {
            return new SelectTagItem(this);
        }
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeString(this.id);
    }

    protected SelectTagItem(Parcel in) {
        this.name = in.readString();
        this.id = in.readString();
    }

    public static final Creator<SelectTagItem> CREATOR = new Creator<SelectTagItem>() {
        @Override
        public SelectTagItem createFromParcel(Parcel source) {
            return new SelectTagItem(source);
        }

        @Override
        public SelectTagItem[] newArray(int size) {
            return new SelectTagItem[size];
        }
    };
}
